# build
FROM node:16-alpine AS builder

# 安装tzdata
RUN apk add --no-cache tzdata
# 设置默认时区
ENV TZ=Asia/Shanghai

WORKDIR /var/www/html

# 切换编译目录
WORKDIR /build
COPY ./frontend/admin ./

# 编译项目
RUN npm config set registry https://registry.npmmirror.com/ \
  && npm install \
  && npm run build:prod \
  && cp -a ./dist/* /var/www/html